package com.gome.ocean.dao.gddl;

import java.util.List;

import org.springframework.beans.factory.DisposableBean;

import com.gome.ocean.common.utils.Pair;
import com.gome.ocean.dao.model.gddl.CommandStatusVO;
import com.gome.ocean.dao.model.gddl.ConnectionStatusVO;
import com.gome.ocean.dao.model.gddl.DataSourcesVO;
import com.gome.ocean.dao.model.gddl.ProcessorStatusVO;
import com.gome.ocean.dao.model.gddl.ServerStatusVO;
import com.gome.ocean.dao.model.gddl.ShowConnectionSQLVO;
import com.gome.ocean.dao.model.gddl.ThreadPoolStatusVO;
import com.gome.ocean.dao.model.gddl.TimeStampVO;

/**
 * 代理适配器dao
 * 
 * @author haqiaolong 2016年3月25日 下午3:11:06
 * @since 5.0.0
 */
public interface ProxyAdapterDAO extends DisposableBean {

    TimeStampVO getCurrentTime(); // show @@time.current

    TimeStampVO getStartUpTime(); // show @@time.startup

    String getVersion(); // show @@version;

    ServerStatusVO getServerStatus(); // show @@server;

    List<ProcessorStatusVO> listProccessorStatus(); // show @@processor

    List<ThreadPoolStatusVO> listThreadPoolStatus(); // show @@threadpool

    List<String> listDataBases(); // show @@databases

    // List<DataNodesStatusVO> listDataNodes(); // show @@dataNodes

    List<DataSourcesVO> listDataSources(); // show @@dataSources

    List<ConnectionStatusVO> listConnectionStatus(); // show @@connection

    List<ShowConnectionSQLVO> listConnectionSQL();

    List<CommandStatusVO> listCommandStatus(); // show @@command

    Pair<Long, Long> getCurrentTimeMillis();

    int switchDataNode(String datanodes, int index); // switch @@datasource
                                                     // datanodes:index

    int stopHeartbeat(String datanodes, int hour_time); // stop @@heartbeat
                                                        // datanodes:hour_time*3600

    int killConnection(long id); // kill @@connection id

    boolean reloadConfig();// reload @@config

    boolean rollbackConfig();// rollback @@config

    boolean checkConnection(); // use show @@version to check cobar connection

    public boolean setProxyStatus(boolean status); // online offline
}
